//JS没有类和实例的概念,所有的对象都是实例,所谓继承关系不过是把一个对象赋值给另一个对象而已(需要通过关键字赋值)
var student = {
	age :20,
	name:'李四',
	run: function(){
		console.log(this.name+"is running...");
	}
}

var xiaoming = {
	name:'小明'
}

xiaoming.__proto__ = student;

//1,原型继承
xiaoming.run();

//2,这三个到底怎么区别
var stu1 = new Object(student);
var stu2 = Object.create(student);
stu1.run();
stu2.run();

console.log(stu1.proto === student);//false
console.log(stu1.__proto__ === student);//false
console.log(stu2.__proto__ === student);//true
console.log(stu1.proto === student.prototype);

console.log(stu1.prototype===stu1);//false
console.log(stu1.prototype===stu1.proto);

//es6新特性:提供了类和构造函数,继承
var v = "hah";
console.log("es6新特性:提供了类和构造函数,继承${v}")
class Person{
	constructor(name,age){
		this.name = name;
		this.age = age;
	}
	show(){
		console.log(name);
	}
}

per = new Person();
per.show();
